<?php
define('RUN_APIV', 1);
//$_cbase['tpl']['tpc_on']  = 0; //是否开启模板缓存
$_cbase['tpl']['vdir'] = 'sapi';
//$_cbase['ucfg']['lang'] = '(auto)'; 
require dirname(__DIR__).'/run/_init.php';

//    /sapi.php?ver=nver&sk=api-xxx&mkv=test-root
// -> /sapi.php/root?ver=nver&sk=api-xxx

$mkv = req('mkv');
if($mkv){
    $uri = $_SERVER["REQUEST_URI"];
    $uri = str_replace(["&mkv=$mkv","?mkv=$mkv"], ['','?'], $uri);
    $uri = str_replace(".php?", ".php/$mkv?", $uri);
    header("Location:$uri"); 
}

$vop = new \imcat\vopSapi();
